Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified export function to avoid change of attribute names, and added test about fill values #526

Closed
wants to merge 21 commits into from

Conversation

mortenwh
Copy link
Contributor

@mortenwh mortenwh commented Jan 3, 2023

Should close #525

mortenwh and others added 20 commits October 23, 2020 16:09
… issue when fill values are not correctly picked up
Comment on lines +34 to +38
try:
import xarray as xr
except:
warnings.warn("'xarray' needs to be installed for Exporter.xr_export to work.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -18,6 +18,7 @@
import tempfile
import datetime
import warnings
import importlib
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

NetCDF file name
"""
# Open new file to edit variable names
ds = Dataset(filename, 'r+')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use with..

del_attrs = []
rename_attrs = []
# Open new file to edit attribute names
ds = Dataset(filename, 'r+')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use with

…'CF-1.5' which is obviously wrong. This is now deleted. Same goes for the history. That should also be handled in the processing software rather then by the gdal netcdf driver.
@akorosov
Copy link
Member

akorosov commented Jan 5, 2023

In addition to the above, can you pleae fix the following error:

FAIL: test_export2thredds_longlat_dict (nansat.tests.test_exporter.ExporterTest)

Traceback (most recent call last):
File "/src/nansat/tests/test_exporter.py", line 343, in test_export2thredds_longlat_dict
self.assertEqual(ncIVar[:].dtype, np.int8)
AssertionError: dtype('uint8') != <class 'numpy.int8'>


Ran 284 tests in 19.624s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=284 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=284 errors=0 failures=1>
Error: Process completed with exit code 1.

@akorosov
Copy link
Member

akorosov commented Jan 5, 2023

I could do all these changes myself in the branch https://github.com/nansencenter/nansat/tree/issue525-new-export

@akorosov
Copy link
Member

akorosov commented Jan 5, 2023

Changes addressed in #528

@akorosov akorosov closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify export function
2 participants